package com.mezz.bones.im.gateway.service;

import com.mezz.bones.im.common.message.base.Message;
import com.mezz.bones.im.common.message.base.MessageHeader;
import com.mezz.bones.im.common.domain.user.ImUserConnectInfo;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;

import java.util.List;
import java.util.Map;

/**
 * @Author: zhuang
 * @Date: 2024/12/6 17:14
 * @Description: TODO
 * @Version: 1.0
 **/

public interface IUserChannelService {
    void addUnAuthChannel(ChannelHandlerContext ctx);

    void removeUnAuthChannel(ChannelHandlerContext ctx);

    void initOnLine(ImUserConnectInfo imUserConnectInfo, ChannelHandlerContext ctx);

    Channel getChannelByUserInfoFromMap(ImUserConnectInfo userInfo);

    List<Channel> getChannelByUserId(String userId);

    void forceOffLine(ImUserConnectInfo userInfo);

    void validMsgData(Message message);

    void validMsgHeader(MessageHeader header);

    ImUserConnectInfo authUserInfo(ChannelHandlerContext ctx, MessageHeader header);

    Integer onlineCount();

    Map<ImUserConnectInfo, Channel> allChannel();

    List<ImUserConnectInfo> allUserChannel(String userId);
}
